package com.yutian.example.demo.proxy;

public class HelloProxyer implements Hello {

    private HelloImpl helloImpl;

    @Override
    public void morning(String name) {
        long now = System.currentTimeMillis(); // 当前距离1970.1.1的毫秒数
        System.out.println("开始代理");
        System.out.println("入参是" + name);
        helloImpl.morning("。。。偷偷加了一段问候");
        System.out.println("结束代理，耗时ms=" + (System.currentTimeMillis() - now));
    }

    public HelloProxyer(HelloImpl helloImpl) {
        this.helloImpl = helloImpl;
    }
}
